package com.moli.iov.down.enums;

/**
 * <p>
 *  操作结果：1、待下发 2、待回应 3、成功 4、失败
 * </p>
 *
 * @author: zql
 * @Date: 2018/12/5 14:33
 */
public enum OperatorResultEnum {

    /**
     * 初始值
     */
    INIT(-1, ""),

    /**
     * 成功
     */
    SUCCESS(1, "成功"),

    /**
     * 失败
     */
    FAIL(2, "失败");


    private int flag;

    private String msg;

    OperatorResultEnum(int flag, String msg){
        this.flag = flag;
        this.msg = msg;
    }

    public static String getMsg(int flag){
        for(OperatorResultEnum e : OperatorResultEnum.values()){
            if(e.flag == flag){
                return e.msg;
            }
        }
        return "";
    }

    public int getFlag() {
        return flag;
    }

    public String getMsg() {
        return msg;
    }}
